import { createRouter, createWebHistory } from "vue-router";

let routes= [
    {
        path: '/',
        name: '首页页面',
        //使用import可以路由懒加载，如果不使用，太多组件一起加载会造成白屏
        component: () => import('../views/Home.vue')
    },
    {
        path: '/login',
        name: '登录页面',
        //使用import可以路由懒加载，如果不使用，太多组件一起加载会造成白屏
        component: () => import('../views/Login.vue')
    },
    {
        path: '/main',
        name: '主页',
        //使用import可以路由懒加载，如果不使用，太多组件一起加载会造成白屏
        component: () => import('../views/Manage/main.vue'),
        children: [
            {
                path: "result",
                meta: { name: "成果管理" },
                component: () => import('../views/Manage/resultManage/result.vue'),
                children:[
                    {
                        path: "patent",
                        name: "专利",
                        component: () => import('../views/Manage/resultManage/patent.vue'),
                    },
                    {
                        path: "papers",
                        name: "论文",
                        component: () => import('../views/Manage/resultManage/papers.vue'),
                    },
                    {
                        path: "software",
                        name: "软件著作",
                        component: () => import('../views/Manage/resultManage/software.vue'),
                    },
                    {
                        path: "PersonalAward",
                        name: "个人获奖",
                        component: () => import('../views/Manage/resultManage/PersonalAward.vue'),
                    },
                    {
                        path: "StudentAward",
                        name: "学生获奖",
                        component: () => import('../views/Manage/resultManage/StudentAward.vue'),
                    },
                    {
                        path: "ContinueEducation",
                        name: "继续教育材料",
                        component: () => import('../views/Manage/resultManage/ContinueEducation.vue'),
                    },
                    {
                        path: "publication",
                        name: "著作",
                        component: () => import('../views/Manage/resultManage/publication.vue'),
                    },
                    {
                        path: "report",
                        name: "新闻报道",
                        component: () => import('../views/Manage/resultManage/Report.vue'),
                    },
                    {
                        path: "Certification",
                        name: "档案资料",
                        component: () => import('../views/Manage/resultManage/Certification.vue'),
                    },
                    {
                        path: "other",
                        name: "其他",
                        component: () => import('../views/Manage/resultManage/other.vue'),
                    },

                ]
            },
            {
                path:"add/papers",
                meta: {name:"新增论文"},
                component: () => import('../views/Manage/Add/AddPapers.vue'),
            },
            {
                path: "edit/papers",
                meta: { name: "编辑论文" },
                component: () => import('../views/Manage/Edit/EditPapers.vue'), // 请确保这个路径正确
            },
            {
                path:"add/patents",
                meta: {name:"新增专利"},
                component: () => import('../views/Manage/Add/AddPatents.vue'),
            },
            {
                path:"edit/patents",
                meta: {name:"编辑专利"},
                component: () => import('../views/Manage/Edit/EditPatents.vue'),
            },
            {
                path:"add/software",
                meta: {name:"新增软件著作"},
                component: () => import('../views/Manage/Add/AddSoftWare.vue'),
            },
            {
                path:"edit/software",
                meta: {name:"编辑软件著作"},
                component: () => import('../views/Manage/Edit/EditSoftWare.vue'),
            },
            {
                path:"add/Personal/Award",
                meta: {name:"新增个人获奖"},
                component: () => import('../views/Manage/Add/AddPersonalAward.vue'),
            },
            {
                path:"edit/Personal/Award",
                meta: {name:"编辑个人获奖"},
                component: () => import('../views/Manage/Edit/EditPersonalAward.vue'),
            },
            {
                path:"add/Student/Award",
                meta: {name:"新增学生获奖"},
                component: () => import('../views/Manage/Add/AddStudentAward.vue'),
            },
            {
                path:"edit/Student/Award",
                meta: {name:"编辑学生获奖"},
                component: () => import('../views/Manage/Edit/EditStudentAward.vue'),
            },
            {
                path:"add/ContinueEducation",
                meta: {name:"新增继续教育材料"},
                component: () => import('../views/Manage/Add/AddContinueEducationMaterial.vue'),
            },
            {
                path:"edit/ContinueEducation",
                meta: {name:"编辑继续教育材料"},
                component: () => import('../views/Manage/Edit/EditContinueEducationMasterial.vue'),
            },
            {
                path:"add/Publication",
                meta: {name:"新增著作"},
                component: () => import('../views/Manage/Add/AddPublication.vue'),
            },
            {
                path:"edit/Publication",
                meta: {name:"编辑著作"},
                component: () => import('../views/Manage/Edit/EditPublication.vue'),
            },
            {
                path:"add/Report",
                meta: {name:"新增新闻报道"},
                component: () => import('../views/Manage/Add/AddReport.vue'),
            },
            {
                path:"edit/Report",
                meta: {name:"编辑新闻报道"},
                component: () => import('../views/Manage/Edit/EditReport.vue'),
            },
            {
                path:"add/Certification",
                meta: {name:"新增档案资料"},
                component: () => import('../views/Manage/Add/AddCertification.vue'),
            },
            {
                path:"edit/Certification",
                meta: {name:"编辑档案资料"},
                component: () => import('../views/Manage/Edit/EditCertification.vue'),
            },
            {
                path:"add/other",
                meta: {name:"新增其他"},
                component: () => import('../views/Manage/Add/AddOther.vue'),
            },
            {
                path:"edit/other",
                meta: {name:"编辑其他"},
                component: () => import('../views/Manage/Edit/EditOther.vue'),
            },
            {
                path:"table",
                meta:{name:"汇总表格"},
                component: () => import('../views/Manage/Assistants/SummaryTable.vue'),
            },
            {
                path:"add/longitudinal",
                meta: {name:"新增纵向课题"},
                component: () => import('../views/Manage/Add/AddLongitudinal.vue'),
            },
            {
                path:"edit/longitudinal",
                meta: {name:"编辑纵向课题"},
                component: () => import('../views/Manage/Edit/EditLongitudinal.vue'),
            },
            {
                path:"add/horizontal",
                meta: {name:"新增横向课题"},
                component: () => import('../views/Manage/Add/AddHorizontal.vue'),
            },
            {
                path:"edit/horizontal",
                meta: {name:"编辑横向课题"},
                component: () => import('../views/Manage/Edit/EditHorizontal.vue'),
            },

            {
                path: "research",
                meta: { name: "课题管理" },
                component: () => import('../views/Manage/researchManage/research.vue'),
                children:[
                    {
                        path: "Longitudinal",
                        name: "纵向课题",
                        component: () => import('../views/Manage/researchManage/Longitudinal.vue'),
                    },
                    {
                        path: "Horizontal",
                        name: "横向课题",
                        component: () => import('../views/Manage/researchManage/Horizontal.vue'),
                    },

                ]
            },
            {
                path: "team",
                meta: { name: "团队工具" },
                component: () => import('../views/Manage/team/team.vue'),
                children: [
                    {
                        path: "addspace",
                        meta: { name: "新增空间" },
                        component: () => import('../views/Manage/team/addSpace.vue'),
                    },

                    {
                        path: "management",
                        meta: { name: "空间管理" },
                        component: () => import('../views/Manage/team/spaceManagement.vue'),
                    },
                    {
                        path: "editspace",
                        meta: { name: "编辑空间" },
                        component: () => import('../views/Manage/team/editSpace.vue'),
                    },
                    {
                        path: "folder",
                        meta: { name: "团队资料夹" },
                        component: () => import('../views/Manage/team/folder.vue'),
                    },
                ]
            },
            {
                path: '/academic/generate',
                meta: { name: "生成材料" },
                component: () => import('../views/academic/generate/index.vue'),
            },
            {
                path: '/academic/solution',
                meta: { name: "结题助手" },
                component: () => import('../views/academic/solution/index.vue'),
            },
            {
                path: '/academic/material',
                meta: { name: "pdf材料生成" },
                component: () => import('../views/academic/material/index.vue'),
            },


        ]
    },
    {
        path: "/personal",
        meta:{name:"个人信息"},
        component: () => import('../views/Manage/personal.vue'),
    },
    {
        path: "/preview",
        name: "PdfPreview",
        component: () => import("@/views/Manage/resultManage/pdfPreview.vue"),
    },
    {
        path: '/401',
        component: () => import('@/views/error/401.vue'),
        hidden: true
    },

]
// 路由
const router = createRouter({
    history: createWebHistory(),
    routes
})
// 导出
export default router
